package com.atguigu.gmall.payment.client;

import com.atguigu.gmall.model.payment.PaymentInfo;
import com.atguigu.gmall.payment.client.impl.PaymentFeignClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

@FeignClient(value = "service-payment",fallback = PaymentFeignClientImpl.class)
public interface PaymentFeignClient {

    //取消支付宝的交易")
    @GetMapping("api/payment/alipay/closePay/{orderId}")
    @ResponseBody
    public Boolean closePay(@PathVariable Long orderId);

    //根据订单id 查询支付宝交易")
    @GetMapping("api/payment/alipay/checkPay/{orderId}")
    @ResponseBody
    public Boolean checkPay(@PathVariable Long orderId);

    //根据out_trade_no以及 支付方式 查询支付信息")
    @GetMapping("api/payment/alipay/getPaymentInfo/{outTradeNo}")
    @ResponseBody
    public PaymentInfo getPaymentInfo(@PathVariable String outTradeNo);
}
